<?php
include '../include/functions.php';
?>
<!DOCtype html PUBLIC "-//W3C//Dtd html 4.01 Transitional//EN"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
  <head>
    <title>JoshHughes.com NHL Hockey Pool</title>
	<link rel="shortcut icon" href="http://hockey.joshhughes.com/NHL/images/nhlFavicon.gif" />
	<link rel="stylesheet" href="http://hockey.joshhughes.com/css/NHL.css" type="text/css">
	<script src="http://hockey.joshhughes.com/scripts/prototype.js" type="text/javascript"></script>
	<script src="http://hockey.joshhughes.com/scripts/scriptaculous.js" type="text/javascript"></script>
	<script src="http://hockey.joshhughes.com/scripts/hockey.js" type="text/javascript"></script>
	<script type="text/javascript" src="http://hockey.joshhughes.com/scripts/calendarDateInput.js">
	/***********************************************
	* Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
	* Script featured on and available at http://www.dynamicdrive.com
	* Keep this notice intact for use.
	***********************************************/
	</script>
  </head>
<body obload="doreload()">
<div id="pagewidth" >
	<div id="header" >
	
		<?PHP include_once("layout/header.html"); ?>
		
	</div>
			<div id="wrapper" class="clearfix" > 
				<div id="maincol" >
	
					
				<?php
				dbConnect();                                 
				//check to see if a Weeknum value was passed, if not, set WeekNum to CurrWeek.
				if (($Weeknum == NULL) || ($Weeknum == ""))
					$Weeknum = getWeek("NHL");
										
				//check to make sure $Weeknum > 1 AND $Weeknum < 21
				$Weeknum = checkWeekBounds($Weeknum);
				
				if (gameInProgress($Weeknum, "NHL"))
				{	?>
					<script type="text/javascript">setTimeout('doreload()',30000);</script>
					<?
				}
				else
				{
					$NumMins = 10;
					$TimeOutSecs = $NumMins * 60000;
				}
				
				if (($ScoreDate == NULL) || ($ScoreDate == ""))
					$ScoreDate = date("Ymd");
				?>
		
				<form action="<? echo $PHP_SELF; ?>" method="POST" name="DateForm" >
					<table bgcolor="#FFFFFF" callpadding="0" cellspacing="0" width="600">
						<tr>
							<td width="300" align="center" rowspan="2"><h2>NHL Game Day Scores</h2></td>
							<td width="100" align="left" valign="top"><script>DateInput('orderdate', true, 'YYYYMMDD', '<?= $ScoreDate;?>')</script></td>
							<td width="100" align="left">
								<input type="hidden" name="ScoreDate" value="" />
								<input type="submit" onClick="this.form.ScoreDate.value = this.form.orderdate.value" value="Get scores">							
							</td>
						</tr>
						<tr>
							<td align="left"><input type="image" SRC="http://hockey.joshhughes.com/images/cal/prev.gif" height="9" width="5" border="0" alt="Previous Day" onClick="this.form.ScoreDate.value='<?= date("Ymd",strtotime($ScoreDate - 1)); ?>'" title="Previous Day" /> <span style="font-size: 0.5em; font-family: courier; color: #000; text-decoration: none;" onClick="this.form.ScoreDate.value = '<?= date("Ymd",strtotime($ScoreDate - 1)); ?>'">Previous</span></td>
							<td align="right"><span style="font-size: 0.5em; font-family: courier; color: #000; text-decoration: none;" onClick="this.form.ScoreDate.value='<?= date("Ymd",strtotime($ScoreDate + 1)); ?>'">Next</span> <input type="image" SRC="http://hockey.joshhughes.com/images/cal/next.gif" height="9" width="5" border="0" alt="Next Day" onClick="this.form.ScoreDate.value = '<?= date("Ymd",strtotime($ScoreDate + 1)); ?>'" title="Next Day" /></td>
						</tr>
					</table>
				</form>
				
				<div class="bluebg" style="width: 600px; padding: 2px;">
					<table width="100%" cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td align="left"><span class="whitelink">View Game Scores</span></td>
							<td align="right"><img src="http://hockey.joshhughes.com/images/showhide.gif" title="Show/Hide Scores" alt="Show/Hide Scores" border="0"  onclick="new Effect.toggle('scoresframe', 'blind');" /></td>
						</tr>
					</table>
					<iframe id="scoresframe" name="scoresframe" src="http://hockey.joshhughes.com/NHL/rss/<?= getSeasonYear("NHL"); ?>/<?= $ScoreDate; ?>.xml" height="350" width="100%" frameborder="0" scrolling="no" ></iframe>
				</div>
			
			</div>
			<div id="leftcol" >
			
				<?PHP include_once("layout/left_column.php"); ?>
		
			</div>
			
		</div>
		
		<div id="footer" >
		
			<?PHP include_once("layout/footer.html"); ?>
			
		</div>
</div>
</body>
</html>
